/**
 * Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 * Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://opensource.org/licenses/MIT
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */

@import '../../css/variable.css';
@import '../../css/mixins/ellipsis.css';

.biz-app-title {
    display: inline-block;
    height: 60px;
    line-height: 60px;
    font-size: 16px;
    margin-left: 20px;
}

.biz-node-content-wrapper {
    .biz-page-box {
        padding: 0px 20px 10px 0;
    }
}

.biz-node-query {
    .left {
        margin-right: 10px;
        float: left;
        color: $fontWeightColor;

        .bk-button {
            border: 1px solid $fnMinorColor;

            &.is-disabled {
                cursor: not-allowed !important;
            }
        }
    }

    .right {
        width: 320px;

        .bk-dropdown-menu {
            float: left;
            right: 493px;
            width: 200px;
            .bk-dropdown-list>li>a {
                width: 100%;
                @mixin ellipsis 240px;
            }
        }

        .toggle-filter {
            width: 200px;
            padding-left: 15px;
            border: 1px solid #dde4eb;
            height: 38px;
            line-height: 36px;
            display: inline-block;
            white-space: nowrap;
            outline: none;
            cursor: pointer;
            white-space: nowrap;
            -webkit-appearance: none;
            vertical-align: middle;
            font-size: 14px;
            background: #fff;
            border-radius: 2px 0 0 2px;
            box-sizing: border-box;
            color: #737987;
            text-decoration: none;
            transition: background-color ease 0.3s;
            .label {
                display: inline-block;
                /* width: 55px; */
                text-align: left;
                @mixin ellipsis 85px;
            }
            .bk-icon {
                color: #c3cdd7;
                margin-left: 0;
                margin-right: 0;
                right: 8px;
                font-weight: 700;
                font-size: 10px;
                top: 14px;
                position: absolute;
            }
        }

        .biz-search-input {
            width: calc(100% - 50px);
            margin-right: 10px;

            input {
                border: 1px solid $borderWeightColor;
                border-radius: 0 2px 2px 0;
            }
        }

        .close-wrapper {
            cursor: pointer;
            display: inline-block;
            position: absolute;
            top: 17px;
            right: 65px;

            button {
                border-color: $borderWeightColor;
                border-left: none;
                border-radius: 0;
                width: 38px;
                height: 38px;
            }
        }

        .refresh-wrapper {
            cursor: pointer;
            display: inline-block;
            position: absolute;
            right: 20px;

            .refresh {
                color: $iconPrimaryColor;
            }

            button {
                border-color: $borderWeightColor;
                width: 38px;
                height: 38px;
            }
        }
    }
}

.biz-node-list {
    margin-bottom: 30px;

    table {
        background-color: #fff;

        thead {
            background-color: $bgHoverColor;
        }

        tbody,
        thead {
            tr {

                th,
                td {
                    height: 50px;
                    font-size: 14px;
                    padding: 0 10px;
                }

                td {
                    height: 60px;
                }

                .tip {
                    font-size: 14px;
                    vertical-align: text-bottom;
                    margin-left: 3px;
                    cursor: pointer;
                }
            }
        }
    }

    .bk-text-button {
        +.bk-text-button {
            margin-left: 10px;
        }
        &.disabled {
            color: #ccc;
            cursor: not-allowed;
        }
    }

    .labels-container {
        position: relative;
        height: 24px;
        overflow: hidden;

        &.expand {
            height: 100%;
            overflow: visible;
        }
    }

    .labels-wrapper {
        float: left;
        max-width: 820px;
        height: auto;
        padding-right: 40px;

        &.expand {
            overflow: visible;
            height: auto;
            padding-top: 10px;
            padding-bottom: 5px;
        }
    }

    .toggle-labels {
        font-size: 12px;
        position: absolute;
        top: 1px;
        float: left;

        i {
            margin-left: 3px;
            position: absolute;
            top: 5px;
        }

        &.expand {
            top: 11px;
        }
    }

    .labels-inner {
        border: 1px solid $borderWeightColor;
        border-radius: 2px;
        height: 24px;
        line-height: 24px;
        float: left;
        margin-right: 5px;
        margin-bottom: 5px;
        font-size: 0;

        .bk-tooltip-rel {
            height: 17px;
            line-height: 22px;
        }

        .key,
        .value {
            @mixin ellipsis 140px;
            font-size: 12px;
            text-align: center;
            padding: 0 10px;
            height: 100%;
        }

        .key {
            background-color: #fff;
            border-right: 1px solid $borderWeightColor;
        }

        .value {
            background-color: $bgHoverColor;
        }
    }

    .cluster-name {
        @mixin ellipsis 500px;
    }

    .already-selected-nums {
        font-size: 14px;
        height: 40px;
        line-height: 40px;
        display: inline-block;
        float: left;
        margin-left: 15px;
        color: #737987;
    }
}

.biz-cluster-set-label-sideslider {
    margin: 0;
    padding: 0;
    z-index: 999;

    .title-tip {
        position: absolute;
        top: 23px;
        font-size: 12px;
        left: 130px;
        color: $fnMinorColor;
    }

    .wrapper {
        padding: 30px 40px 40px;
    }

    .flex-item {
        display: flex;

        .left,
        .right {
            flex: 1;
        }

        .right {
            margin-left: -30px;
        }
    }

    .biz-key-value-wrapper {
        .biz-key-value-item {
            position: relative;
            margin-bottom: 10px;

            input.right {
                margin-left: 35px;
            }

            .equals-sign {
                color: $fnMinorColor;
                position: absolute;
                top: 6px;
                display: inline-block;
                left: 294px;
            }
        }

        .bk-form-input {
            width: 280px;
        }

        .action-btn {
            width: auto;
            padding: 0;
            height: 36px;
            text-align: center;
            display: inline-block;
            border: none;
            background: transparent;
            outline: none;
            margin-left: 5px;

            .bk-icon {
                width: 24px;
                height: 24px;
                line-height: 24px;
                border-radius: 50%;
                vertical-align: middle;
                color: $fontWeightColor;
                font-size: 14px;
                display: inline-block;
                border: 1px solid $borderWeightColor;
            }
        }
    }

    .set-label-form {
        .bk-tooltip-inner {
            max-width: 260px;
        }

        .bk-form-item+.bk-form-item {
            margin-top: 5px;
        }

        .label {
            color: $fontWeightColor;
            font-size: 14px;
            font-weight: 700;
        }

        .action-inner {
            margin-top: 30px;

            button {
                width: 90px;
            }

            button+button {
                margin-left: 0;
            }
        }
    }

    button.disabled {
        background-color: #fafafa;
        border-color: $borderLightColor;
        color: #ccc;
        cursor: not-allowed;

        &:hover {
            background-color: #fafafa;
            border-color: $borderLightColor;
        }
    }
}

.biz-log-box {
    font-size: 12px;

    .operation-item {
        padding: 10px 0;
        border-bottom: 1px solid $borderWeightColor;

        &:last-child {
            border-bottom: none;
        }
    }

    .log-message {
        line-height: 22px;
        font-size: 12px;
        padding: 0;
        font-family: Microsoft Yahei;
        margin: 0 0 5px 0;

        &.title {
            font-size: 14px;
            font-weight: 700;
        }

        &.item {
            margin-left: 20px;
        }
    }
}

.biz-searcher-wrapper {
    width: 540px;
    position: absolute;
    right: 94px;
}

/* 自适应 */
@media screen and (max-width: $mediaMidWidth) {
    .biz-node-list {
        .biz-text-wrapper {
            vertical-align: middle;
            line-height: 30px;
            @mixin ellipsis 300px;
        }
    }
}

@media screen and (max-width: 1400px) {
    .bk-text-button {
        vertical-align: bottom;
        @mixin ellipsis 300px;
    }

    .biz-node-list {
        .cluster-name {
            @mixin ellipsis 380px;
        }
    }
}


@media screen and (max-width: 1280px) {
    .bk-text-button {
        vertical-align: bottom;
        @mixin ellipsis 200px;
    }
    .biz-node-list {
        .labels-wrapper {
            max-width: 310px;
        }

        .labels-inner {

            .key,
            .value {
                @mixin ellipsis 60px;
            }
        }
    }
}
